import java.awt.Color;


public class Main {
	public static void main(String args[]){
		Menu m = new Menu(640,480);
		Screen screen1 = new Screen(m.textureBlue,m);
		Screen screen2 = new Screen(m.textureEarth,m);
		Screen screen3 = new Screen(m.textureMarble,m);
		Screen screen4 = new Screen(m.textureTrippy2,m);
		m.setCurrentScreen(screen1);
		screen1.addButton(new Button(screen1.getBgImg().getWidth()/2, screen1.getBgImg().getHeight()/2, 50, 200, m.textureGreen, new Color(255,255,255), screen3));
		screen2.addButton(new Button(screen1.getBgImg().getWidth()/2, screen1.getBgImg().getHeight()/2, 50, 200, m.textureRed, new Color(255,255,255), screen4));
		screen3.addButton(new Button(screen1.getBgImg().getWidth()/2, screen1.getBgImg().getHeight()/2, 50, 200, m.textureSun, new Color(255,255,255), screen2));
		screen4.addButton(new Button(screen1.getBgImg().getWidth()/2, screen1.getBgImg().getHeight()/2, 50, 200, m.textureTrippy2, new Color(255,255,255), screen1));
		
		long curTime=System.currentTimeMillis();
		int i=0;


		screen1.addSprite(new Sprite(screen1,m.testSprite,250,110,-0.5,0.0,0.0,0.0));
		screen1.addSprite(new Sprite(screen1,m.testSprite,230,100,0.5,0.0,0.0,0.0));
		while(true){
			if(System.currentTimeMillis()-curTime>5000){
				curTime=System.currentTimeMillis();
				System.out.println(i);
				i=0;
				screen1.addSprite(new Sprite(screen1,m.testSprite,500,110,-1.0,0.0,0.0,0.0));
				screen1.addSprite(new Sprite(screen1,m.testSprite,100,100,1.0,0.0,0.0,0.0));
			}else{
				i++;
			}
			m.paint();
		}
	}
}
